<template>
  <div>
  <h2>我是用户组件</h2>
  <p>Userhaha</p>
  <h2>{{userId}}</h2>
  <h2>{{$route.params.userId}}</h2>
</div>
</template>

<script>
    export default {
        name: "User",
        computed: {
            userId() {
              //route代表处于活跃的路由
              return this.$route.params.userId
            }
        }
    }
</script>

<style scoped>

</style>
